package com.up.vms.domain.vm.service;

import com.up.vms.domain.vm.entity.UserActivityInfo;
import com.up.vms.domain.vm.repository.UserActivityInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserActivityInfoService {
    @Autowired
    private UserActivityInfoRepository userActivityInfoRepository;

    public Long countByIdNumberAndActivityId(String idNumber, Long activityId) {
        return userActivityInfoRepository.countByIdNumberAndActivityId(idNumber, activityId);
    }

    public UserActivityInfo findByIdNumberAndActivityId(String idNumber, Long activityId){
        return userActivityInfoRepository.findByIdNumberAndActivityId(idNumber, activityId);
    }

    public void save(UserActivityInfo userActivityInfo) {
        userActivityInfoRepository.save(userActivityInfo);
    }

    public void deleteByActivityId(Long activityId) {
        userActivityInfoRepository.deleteByActivityId(activityId);
    }
}
